package com.ruoyi.project.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mapper.AccountAnnalMapper;
import com.ruoyi.project.domain.AccountAnnal;
import com.ruoyi.project.service.IAccountAnnalService;
import com.ruoyi.common.support.Convert;

/**
 * 账户变动记录 服务层实现
 * 
 * @author ruoyi
 * @date 2018-11-01
 */
@Service
public class AccountAnnalServiceImpl implements IAccountAnnalService 
{
	@Autowired
	private AccountAnnalMapper accountAnnalMapper;

	/**
     * 查询账户变动记录信息
     * 
     * @param accountAnnalId 账户变动记录ID
     * @return 账户变动记录信息
     */
    @Override
	public AccountAnnal selectAccountAnnalById(Long accountAnnalId)
	{
	    return accountAnnalMapper.selectAccountAnnalById(accountAnnalId);
	}
	
	/**
     * 查询账户变动记录列表
     * 
     * @param accountAnnal 账户变动记录信息
     * @return 账户变动记录集合
     */
	@Override
	public List<AccountAnnal> selectAccountAnnalList(AccountAnnal accountAnnal)
	{
	    return accountAnnalMapper.selectAccountAnnalList(accountAnnal);
	}
	
    /**
     * 新增账户变动记录
     * 
     * @param accountAnnal 账户变动记录信息
     * @return 结果
     */
	@Override
	public int insertAccountAnnal(AccountAnnal accountAnnal)
	{
	    return accountAnnalMapper.insertAccountAnnal(accountAnnal);
	}
	
	/**
     * 修改账户变动记录
     * 
     * @param accountAnnal 账户变动记录信息
     * @return 结果
     */
	@Override
	public int updateAccountAnnal(AccountAnnal accountAnnal)
	{
	    return accountAnnalMapper.updateAccountAnnal(accountAnnal);
	}

	/**
     * 删除账户变动记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteAccountAnnalByIds(String ids)
	{
		return accountAnnalMapper.deleteAccountAnnalByIds(Convert.toStrArray(ids));
	}

	/**
	 * 根据账户编号查询账户变动记录
	 * @param accountId
	 * @return
	 */
	@Override
	public List<AccountAnnal> selectAccountAnnalaccountId(long accountId){
		AccountAnnal accountAnnal=new AccountAnnal();
		accountAnnal.setAccountAnnalId(accountId);
		return accountAnnalMapper.selectAccountAnnalList(accountAnnal);
	}

	/**
	 * 根据用户id查询账户变动记录
	 * @param userId
	 * @return
	 */
	@Override
	public List<AccountAnnal> selectAccountAnnaluserId(long userId) {
		AccountAnnal accountAnnal = new AccountAnnal();
		accountAnnal.setUserId(userId);
		return accountAnnalMapper.selectAccountAnnalList(accountAnnal);

	}


}
